package abacab.remote.message;

/**
 * Represents a serialized message
 * 
 * @param <T>
 *          the message's type
 */
public final class SerializedMessage<T> {
	/** The message */
	private final transient T	message;

	/** The serialized form of the message */
	private final byte[]			serializedForm;

	/**
	 * @param message
	 *          the message
	 * @param serializedForm
	 *          the serialized form of the message
	 */
	public SerializedMessage(T message, byte[] serializedForm) {
		this.message = message;
		this.serializedForm = serializedForm;
	}

	/**
	 * @return the message
	 */
	public T getMessage() {
		return this.message;
	}

	/**
	 * @return the serialized form of the message
	 */
	public byte[] getSerializedForm() {
		return this.serializedForm;
	}
}